export default {
  state: {
    config: null,
  },
  getters:{
    config: (state, getters, rootState) => {
      let config = rootState.site.config;
      if(config==null){
        config = JSON.parse(sessionStorage.getItem('site_config'));
        rootState.site.config = config;
        sessionStorage.setItem('site_config',JSON.stringify(config));
      }
      return config;
    }
  },
  mutations: {
    setConfig(state,config){
      state.config = config;
      sessionStorage.setItem('app_config',JSON.stringify(config));
    },
  },
  actions: {}
}
